<?php

use Illuminate\Database\Seeder;
use App\System\Cms\Model\CmsMsgObjRel;
use Faker\Factory;

class CmsMsgObjRelTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run(CmsMsgObjRel $cmsMsgObjRel)
    {
        //先清空表
        $cmsMsgObjRel->truncate();
        //实例化faker类
        $faker = Factory::create('zh_CN');//生成中文数据
        //循环
        for ($i = 0; $i < 30; $i++) {
            $cmsMsgObjRel->insert([
                'msg_id'     => $i + 1,
                'user_id'    => '0',
                'org_id'     => '2',
                'created_at' => date('Y-m-d H:i:s', time()),
            ]);
        }
    }
}
